<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width , initial-scale=1.0">
    <title>Document</title>
    
    
</head>
<body>

    <div id="aaa">
        <template v-if=" type==='name'">
            <label >用户名:</label>
            <input placeholder="输入用户名">
        </template>
       
        <template v-else>
            <label >邮箱:</label>
            <input placeholder="输入邮箱">
        </template>
    </div>

    <button @click="handleToggleClick">切换输入类型</button>

    <script>
        var aaa=new Vue({
            el:'#aaa',
            data:{
                type:'name'
            },
            methods:{
                handleToggleClick:function(){
                    this.type=this.type==='name'?'mail':'name';
                }
            }
        })
    </script>


    <div id="app">
       
        <ul>
            <li v-for="s in students">{{s.name}}</li>
        </ul>
        <label for="">{{message}}</label>

        <span v-bind:title="message"><!--双向-->

        </span>

        <div v-if="canSee">
            你看不见我~
        </div>
    </div>
    <!-- 优化了尺寸和速度 -->
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script>
        var app=new Vue({
            el:'#app',
            data:{
                students:[
                    {name:'王哈哈'},
                    {name:'李嘻嘻'},
                    {name:'张嘿嘿'},
                    {name:'朱哼哼'},
                    {name:'羊咩咩'}
                ],
                message:'这个页面创建于'+new Date().toLocaleString(),
                canSee:true
            }
        })
    </script>
</body>
</html>